package 继承;

public class this括号的作用 {
    public static void main(String[] args) {
        //实现了如果只输入学生姓名那么默认学校是黑马
        //注意super和this要放在第一行且不能同时出现在同一个构造器
        TH s=new TH("朱佳铖");
        System.out.println(s.getName()+"  "+s.getSchool());//朱佳铖  浙江工贸
    }
}
class TH{
    private String name;
    private String school;
    public TH(String name){
        this(name,"浙江工贸");
    }
    public TH(String name,String school){
        this.name=name;
        this.school=school;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }
}
